﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HZ.BidSystem.Model;
using System.Data;

namespace HZ.BidSystem.IBLL
{
    /// <summary>
    /// 企业管理业务类
    /// </summary>
    public interface IBLL_Manage
    {
        /// <summary>
        /// 初始化密码
        /// </summary>
        /// <param name="compnaylist">企业列表</param>
        int ResetPassword(IList<int> compnaylist, int projectid);
        /// <summary>
        /// 清楚报价密码
        /// </summary>
        /// <param name="companylist"></param>
        int ClearBidPassword(IList<int> companylist, int projectid);
        /// <summary>
        /// 清楚企业确认报价状态
        /// </summary>
        /// <param name="companylist"></param>
        int ClearComfirmStatus(IList<int> companylist, int projectid);
        /// <summary>
        /// 清楚所有企业确认报价状态
        /// </summary>
        int ClearComfirmStatusAll(int projectid);
        /// <summary>
        /// 清空所有企业解密状态
        /// </summary>
        /// <param name="projectid"></param>
        int ClearDecStatusAll(int projectid);
        /// <summary>
        /// 报价信息公示
        /// </summary>
        int CompanyMessageGongshi();
        /// <summary>
        /// 获取报价状态
        /// </summary>
        /// <param name="where"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        IList<STAT_BidStatus> GetBidStatus(object where, int currentpage, int pagesize, out int totalrecord);
        /// <summary>
        /// 获取报价状态
        /// </summary>
        /// <param name="where"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        DataTable GetBidStatusNew(string where, int currentpage, int pagesize, out int totalrecord);
        /// <summary>
        /// 获取日志
        /// </summary>
        /// <param name="where"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        IList<Log> GetBidLog(object where, int currentpage, int pagesize, out int totalrecord);

        /// 获取解密状态
        /// </summary>
        /// <param name="where"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        IList<HZ.BidSystem.Model.View.View_DecStatus_Company> GetDecStatus(object where, int currentpage, int pagesize, out int totalrecord);

        /// <summary>
        /// 根据项目获取竞价
        /// </summary>
        /// <param name="project"></param>
        /// <returns></returns>
        IList<CompeteTimeConfig> GetCompeteTimeConfigByProjectid(int project);

        /// <summary>
        /// 竞价时间设置
        /// </summary>
        /// <param name="list">设置列表</param>
        /// <returns>1 成功 0 失败</returns>
        int SetCompeteTimeConfig(IList<CompeteTimeConfig> list);
        /// <summary>
        /// 获取项目配置
        /// </summary>
        /// <param name="Projectid"></param>
        /// <returns></returns>
        ProjectConfig GetProjectConfig(int Projectid);
        /// <summary>
        /// 设置项目配置
        /// </summary>
        /// <param name="projectconfig"></param>
        /// <returns></returns>
        int SetProjectConfig(ProjectConfig projectconfig);

        /// <summary>
        /// 获取企业列表
        /// </summary>
        /// <param name="where">查询条件</param>
        /// <param name="currentpage">当前页</param>
        /// <param name="pagesize">页大小</param>
        /// <param name="totalrecord">记录总数</param>
        /// <returns>列表</returns>
        IList<Company> GetCompanyList(object where, int currentpage, int pagesize, out int totalrecord);


        #region 信息提示配置

        /// <summary>
        /// 获取所有信息键
        /// </summary>
        /// <returns></returns>
        IList<string> GetConfigurationKeys();

        /// <summary>
        /// 根据键获取配置内容
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        Configuration GetConfigurationByKey(string key);

        /// <summary>
        /// 设置指定键的内容
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        int SetConfiguration(string key, string value);

        #endregion


        #region 企业管理

        /// <summary>
        /// 获取项目报价企业列表
        /// </summary>
        /// <param name="where"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        IList<View_Company_Project_Switch> GetCompany_Project(object where, int currentpage, int pagesize, out int totalrecord);

        #endregion


        #region 限价管理

        /// <summary>
        /// 修改限价
        /// </summary>
        /// <param name="goodsid">流水号</param>
        /// <param name="limitprice">限价</param>
        /// <returns></returns>
        int UpdateLimitPrice(string Company_Goods, double limitprice);

        #endregion


        #region 三方密码设置


        /// <summary>
        /// 获取三方密码设置
        /// </summary>
        /// <param name="projectid">项目编号</param>
        /// <returns>设置列表</returns>
        IList<ThreePwdConfig> GetThreePwdConfig(int projectid);

        /// <summary>
        /// 设置三方密码
        /// </summary>
        /// <param name="threepwdconfig">设置实体</param>
        /// <returns></returns>
        int SetThreePwdConfig(ThreePwdConfig threepwdconfig);

        /// <summary>
        /// 验证三方密码
        /// </summary>
        /// <param name="threepwdconfig">设置编号</param>
        /// <param name="pwd">密码</param>
        /// <returns>1 成功 ， 2 密码不正确， 3 编号不存在</returns>
        int CheckThreePwdConfig(ThreePwdConfig threepwdconfig, string pwd);


        /// <summary>
        /// 设置三方解密数据
        /// </summary>
        /// <param name="projectid">项目编号</param>
        /// <param name="count">三方账号数据</param>
        /// <returns></returns>
        int SetThreePwdConfigCount(int projectid, int count);

        /// <summary>
        /// 中心端解密
        /// </summary>
        /// <param name="projectid"></param>
        /// <returns></returns>
        int DecByCenter(int projectid);
        #endregion


        #region 导入议价数据

        /// <summary>
        /// 清空议价数据
        /// </summary>
        /// <returns></returns>
        int ClearBargainData();

        /// <summary>
        /// 通过Dt导入议价
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        int ImportBaragainData(System.Data.DataTable dt);


        #endregion
    }
}
